package GUI;

import java.awt.CardLayout;
import java.io.IOException;

import javax.swing.JFrame;
import javax.swing.JPanel;
import java.awt.Toolkit;

/**
 * this class  implements GUI main screen 
 * @author Gabi Revah
 */
public class MainScreen extends JFrame  {
	public static JFrame frm;
	
	/**
	 * constructor of main screen 
	 */
	public MainScreen() {
		setIconImage(Toolkit.getDefaultToolkit().getImage(MainScreen.class.getResource("/Images/eye4.png")));
	}

	public static CardLayout cardLayot;
	public static JPanel card = new JPanel();
	
	//public static Object contentPane;
	/**
	 * Create the main screen frame 
	 * @throws IOException
	 */
	public static void BuildScreen() throws IOException
	{
		

		frm= new JFrame();
		JPanel contentPane = (JPanel)frm.getContentPane();
		card.setLayout(cardLayot = new CardLayout());

		Login loginframe= new Login();
	
		card.add("Login", loginframe);
		cardLayot.show(card, "Login Screen");
		contentPane.add(card);
		frm.setSize(1050,770);  
		frm.setVisible(true);
		frm.setResizable(true);
		
		frm.setLocation(0, 0);
		frm.setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
		//frm.setDefaultCloseOperation(frm.EXIT_ON_CLOSE);
		frm.setTitle("HTS Center");
		
	}
/**
 * get the corrent card
 * @return the correct jpanel 
 */
	public static JPanel getCard() {
		return card;
	}
/**
 * set the correct card 
 * @param the Jpanel 
 */
	public static void setCard(JPanel card) {
		MainScreen.card = card;
		
	}
	
	

}
